<script setup lang="ts">
    import TestPropsEmit from './components/test-props-emit/index.vue';
    import { ref, onMounted, onUnmounted } from 'vue';

    const msg = ref('欢迎学习vite')

    const handleChange = (params:string)=>{
        // console.log(params);
    }
    const propsEmitRef = ref()
    onMounted(()=>{
        // console.log(propsEmitRef.value.child, propsEmitRef.value.childNode());
        console.log('onMounted');
    })
    // 在页面加载完成之前调用的方式，相当于created钩子
    function createds(){
        console.log('created');
    }
    createds()
</script>

<template>
    <TestPropsEmit ref="propsEmitRef" :msg='msg' @on-change="handleChange"></TestPropsEmit>
</template>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
